<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>
<head>
<jsp:include page="../inc_jqgrid.jsp"></jsp:include>
<script type="text/javascript"> 
var json = parent.$("#flights").html();
var myjsongrid = eval("("+json+")"); 
$(document).ready(function () {
	$("#jqGrid").jqGrid({
		data: myjsongrid,
		datatype: "local",
		styleUI : 'Bootstrap',
		height: 'auto',
		autowidth: true,
		rowNum: 10,
		rowList: [10,20,30],
	   	colNames:['月份','去程日期','去程星期', '回程日期', '回程星期','单价（CNY）'],
	   	colModel:[
	   		{name:'month',index:'month', width:60, sorttype:"int"},
	   		{name:'startDate',index:'startDate', width:120, sorttype:"date"},
	   		{name:'startWeek',index:'startWeek', width:100},
	   		{name:'returnDate',index:'returnDate', width:120, sorttype:"date"},
	   		{name:'returnWeek',index:'returnWeek', width:100},
	   		{name:'unitPrice',index:'unitPrice', width:100, align:"right",sorttype:"float"}
	   	],
	   	pager: "#jqGridPager",
	   	viewrecords: true,
	   	shrinkToFit:false,//按比例初始化列宽度
	   	sortname: 'startDate',
	   	grouping:true,
	   	groupingView : {
	   		groupField : ['month'],
	   		groupColumnShow : [false],
	   	 	groupOrder:['startDate','asc'] ,
	   		groupText : ['<b>{0}月 - {1}条记录</b>']//表头显示数据(每组中包含的数据量)
	   	},
	   	caption: ""
	});
});

</script>
</head>
<body >
	<div style="width: 100%">
	    <table id="jqGrid"></table>
	    <div id="jqGridPager">
    </div>
</div>


</body>
</html>